package my.framework.dubbo.sample.user.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import my.framework.dubbo.sample.model.user.UserDO;
import my.framework.dubbo.sample.service.user.UserService;
import my.framework.dubbo.sample.user.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * @author xuexue
 * @date 2018/11/14 19:58
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void register(UserDO userDO) {

    }

    @Override
    public UserDO Login(String uname, String upwd) {
        return null;
    }

    @Override
    @Cacheable(value = "users",key = "#userDO.id")
    public UserDO queryUser(UserDO userDO) {
        return userMapper.queryUser(userDO);
    }

    @Override
    public List<UserDO> queryAll() {
        return userMapper.queryAll();
    }
}
